#include "choose.h"
#include "ui_choose.h"

choose::choose(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::choose)
{
    ui->setupUi(this);
    this->setGeometry(QRect(250,150,1200,800));
}

choose::~choose()
{
    delete ui;
}

void choose::paintEvent(QPaintEvent *event)
{
    QPainter painter(this);
    painter.drawPixmap(0,0,1200,800,QPixmap(":/new/prefix1/p3.jpg"));
    painter.drawPixmap(50,250,200,200,QPixmap(":/new/prefix1/cat_1.jpg"));
    painter.drawPixmap(470,250,240,200,QPixmap(":/new/prefix1/cat_2.png"));
    painter.drawPixmap(920,250,240,200,QPixmap(":/new/prefix1/cat_3.png"));

}

void choose::on_cat_1_clicked()
{
    this->hide();
    ga=new game();
    ga->cat_type=1;
    ga->show();
}

void choose::on_cat_2_clicked()
{
    this->hide();
    ga=new game();
    ga->cat_type=2;
    ga->show();
}

void choose::on_cat_3_clicked()
{
    this->hide();
    ga=new game();
    ga->cat_type=3;
    ga->show();
}

void game::on_returnButton_clicked()
{
    QMessageBox::information(NULL,"喵呜~","喵喵重新上路喽~");
    this->hide();
    choose* ch_1=new choose;
    ch_1->show();
}
